import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { PlayConfig } from './entities/play_config.entity';
import { PlayConfigService } from './play_config.service';
import { CreatePlayConfigDto } from './dto/create-play_config.dto';
import { UpdatePlayConfigDto } from './dto/update-play_config.dto';

@Controller('play_config')
export class PlayConfigController {
  constructor(private readonly playConfigService: PlayConfigService) {}

  @Post()
  create(@Body() createPlayConfigDto: CreatePlayConfigDto) {
    return this.playConfigService.create(createPlayConfigDto);
  }

  @Get('all_data')
  findAll(): Promise<PlayConfig> {
    return this.playConfigService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.playConfigService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updatePlayConfigDto: UpdatePlayConfigDto) {
    return this.playConfigService.update(+id, updatePlayConfigDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.playConfigService.remove(+id);
  }
}
